This is probably more a general C++ question, but I'm working on a POV
project, so I know you'll be glad to help. How do I assign some typed
pointer X to an element of a void pointer array? Here's what I have
(greatly simplified):
void **array;
array=(void **) malloc(sizeof(void *)*NumberOfElements);
CMyObject *thing;
thing=new CMyObject();
location=&array[4];
//compiler chokes here (invalid indirection):
*location=thing;
Thanks in advance for your invaluable help.
Post a reply to this message
|